/**
 * col_datetime
 */
layui.define(['YunjColsTemplet','jquery','yunj'], function (exports) {

    let YunjColsTemplet = layui.YunjColsTemplet;
    let doc = document;
    let $ = layui.jquery;

    class YunjColsTempletDatetime extends YunjColsTemplet{

        constructor(options) {
            super(options);
        }

        layout(){
            let that=this;
            return `{{# let datetime = yunj.timestampFormat(d.${that.key}); }}
                     <span class="layui-badge layui-bg-gray table-row-datetime" title="{{ datetime }}">{{ datetime }}</span>`;
        }

        defineExtraEventBind(){
            let that=this;

            $(doc).on('click','.table-row-datetime',function () {
                yunj.copy($(this).text());
            });
        }

    }

    exports('col_datetime', YunjColsTempletDatetime);
});